package com.fadadianqi.logistics.admin.net;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class PacketRouter {

    private static final Log log = LogFactory.getLog(PacketRouter.class);

    private PacketDeliverer deliverer;

    public PacketRouter(PacketDeliverer deliverer) {
        this.deliverer = deliverer;
    }

    public void route(Packet packet) {
        try {
            deliverer.deliver(packet);
        } catch (PacketDeliverException e) {
            log.error(e.toString());
        }
    }
}
